package com.battle.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import lombok.Data;
import nirvana.core.domains.ann.AccEntity;
import nirvana.core.domains.entity.DomainBaseEntity;
import nirvana.core.domains.enums.EntityType;
import org.springframework.data.annotation.Id;

import javax.persistence.Table;

/**
 * @author Joseph.Li
 * @author joseph.li@king-v.com
 * Created in 2022-06-16 22:51
 *
 *  树节点，维护祖先于后代的关系
 *
 */
@Data
@TableName(value = "TREE_NODE")
@Entity(name = "TREE_NODE")
@AccEntity(value = "树节点", type = EntityType.SERVICE_ENTITY)
public class TreeNode extends DomainBaseEntity<TreeNode> {



    /**
     * 祖先
     */
    @Column(nullable = false)
    private Long progenitor;


    /**
     * 后代
     */
    @Column(nullable = false)
    private Long descendant;


    /**
     * 距离
     */
    @Column(length = 20,
            nullable = false)
    private Integer distance;

}
